<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>

<% 
String _basePath = request.getContextPath();
String ctx = request.getContextPath();

response.setContentType("application/vnd.ms-excel");
String filename = new String(("任务导出").getBytes(),"ISO-8859-1");
response.addHeader("Content-Disposition", "filename=" + filename + ".xls");
%>

<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<meta http-equiv="Pragma" content="no-cache" />
	<title>四川通信科研规划设计有限责任公司 - 勘察管理系统</title>
</head>

<body>

<table class="table-striped" width="1800" border="1">
	<thead>
	    <tr>
	        <th>名称</th>
	        <th>定位时间</th>
	        <th>勘察地点</th>
	        <th>勘察人员</th>
	        <th>所在部门</th>
	        <th>勘察内容</th>
	        <th>派发人</th>
	        <th>派发时间</th>
	        <th>要求时间</th>
	        <th>照片1</th>
	        <th>描述1</th>
	        <th>照片2</th>
	        <th>描述2</th>
	        <th>照片3</th>
	        <th>描述3</th>
	        <th>照片3</th>
	        <th>描述3</th>
	        <th>照片4</th>
	        <th>描述4</th>
	        <th>照片5</th>
	        <th>描述5</th>
	        <th>照片6</th>
	        <th>描述6</th>
	        <th>照片7</th>
	        <th>描述7</th>
	        <th>照片8</th>
	        <th>描述8</th>
	        <th>照片9</th>
	        <th>描述9</th>
	        <th>照片10</th>
	        <th>描述10</th>
	    </tr>
	</thead>
	<c:forEach var="task" items="${tasks}" varStatus="status">
	<tbody>
	    <tr>
	        <td>${task.name}</td>
	        <td><fmt:formatDate value="${task.locateDate}" pattern="yyyy-MM-dd HH:mm"/></td>
	        <td>${task.locationAddress}</td>
	        <td>${task.execPersonName}</td>
	        <td>${task.execOrganName}</td>
	        <td>${task.description}</td>
	        <td>${task.creatorName}</td>
	        <td><fmt:formatDate value="${task.assignedDate}" pattern="yyyy-MM-dd"/></td>
	        <td><fmt:formatDate value="${task.planEndDate}" pattern="yyyy-MM-dd"/></td>
	        <c:set var="attachments" value="${task.attachments}"></c:set>
	        <c:forEach var="attach" items="${attachments}">
		        <td><img width="150" src="${root}${attach.orgiUri}" /></td>
		        <td>${attach.description}</td>
	        </c:forEach>
	        <c:forEach var="i" begin="${fn:length(attachments)}" end="10" step="1">
		        <td>&nbsp;</td>
		        <td>&nbsp;</td>
	        </c:forEach>
	    </tr>
	</tbody>
	</c:forEach>
</table>

</body>
</html>